package com.kylin.upms.biz.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.kylin.upms.biz.entity.Menu;
import com.kylin.upms.biz.mapper.MenuMapper;
import com.kylin.upms.biz.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Mht
 * @since 2019-04-11
 */
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IMenuService {

    @Autowired
    MenuMapper menuMapper;

    @Override
    public List<Menu> getMenuByUserID(Integer id) {
        return menuMapper.getMenuByUserID(id);
    }

    @Autowired
    RedisTemplate redisTemplate;


    @Cacheable(value="menuAll")
    @Override
    public List<Menu> getMenuAll() {
        return menuMapper.getMenuAll();
    }

    @Override
    public List<Menu> getMenuListAll() {
        return menuMapper.getMenuListAll();
    }
}
